/**
 * 
 */
package com.jolestar.yayaweibotong.task;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.jolestar.yayaweibotong.controller.AbstractAction;

/**
 * @author jolestar@gmail.com
 * 
 */
public class CronJobAction extends AbstractAction {

	private CronJob cronJob;
	/**
	 * 
	 */
	public CronJobAction(CronJob cronJob) {
		super(cronJob.jobName);
		this.cronJob = cronJob;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.jolestar.yayaweibotong.controller.AbstractAction#doAction(javax.servlet
	 * .http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected String doAction(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		this.cronJob.doJob();
		return null;
	}

	@Override
	public String getPath() {
		return "/admin/cron/"+this.getName();
	}

}
